{% extends "base.html" %}
{% load fieldsets %}

{% block title %}Account{% endblock %}

{% block content %}

<h2>Change account information</h2>

<form id="accountform" action="{% url shop.views.auth.account %}" method="post">
    {% csrf_token %}
    {{ form.non_field_errors }}

    <fieldset>
        <legend><span>Change Account Information</span></legend>
        {% get_fieldset username,password,password2,password3 as account_information from form %}
        <ul>
            {{ account_information.as_ul }}
        </ul>
    </fieldset>
    <fieldset>
        <legend><span>Change Contact Information</span></legend>
        {% get_fieldset firstname,lastname,email,phonenumber as contact_information from form %}
        <ul>
            {{ contact_information.as_ul }}
        </ul>
    </fieldset>
    <fieldset>
        <legend><span>Change Delivery Address</span></legend>
        {% get_fieldset street_address,postal_code,city,country as delivery_address from form %}
        <ul>
            {{ delivery_address.as_ul }}
        </ul>
    </fieldset>
    <p><input type="submit" value="Change"/></p>
</form>

{% endblock %}

{% block scripts %}
    {{ block.super }}
    <script type="text/javascript" src="{{ MEDIA_URL}}js/jquery.validate.js"></script>
    <script type="text/javascript" src="{{ MEDIA_URL}}js/account_validation.js"></script>
{% endblock %}
